import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait

# 启动浏览器获取驱动
driver = webdriver.Chrome()
driver.get('https://www.jd.com/')
# 页面最大化
driver.maximize_window()

# 实现自动化操作业务流程
driver.find_element(By.XPATH, '//*[@id="key"]').send_keys("空军一号男")
# //*[@id="search"]/div/div[2]/button  这个是登录态的xpath路径
driver.find_element(By.XPATH, '//*[@id="search"]/div/div[2]/button').click()
# 隐式等待
# driver.implicitly_wait(2)
# 强制等待
time.sleep(10)
# 退出
# driver.quit()
